package cn.gov.pbc.dream.pojo.bo;

import cn.gov.pbc.dream.util.DateTimeUtil;
import lombok.Data;
import lombok.ToString;

import java.io.BufferedReader;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Data
@ToString
public class PPE1Bo {

    List<BufferedReader> bufferedReaderList = new ArrayList<>();

    List<AssetPoolTerminationInfo> assetPoolTerminationInfoList = new ArrayList<>();

    @Data
    @ToString
    public class AssetPoolTerminationInfo{
        private String assetPoolCode;

        private Date terminationDate;
    }

    public void assembleAssetPoolTerminationInfo(String data){
        String[] values = data.split("\\|", 2);
        AssetPoolTerminationInfo terminationInfo = new AssetPoolTerminationInfo();
        terminationInfo.setAssetPoolCode(values[0]);
        terminationInfo.setTerminationDate(DateTimeUtil.strToDate(values[1], DateTimeUtil.DASH_DATE_FORMAT));
        this.assetPoolTerminationInfoList.add(terminationInfo);
    }
}
